<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#coursename').formValidator({autotip:true,onshow:"<?php echo L('please_input_course_name')?>",onfocus:"<?php echo L('please_input_course_name')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_input_course_name')?>"});
	$('#agency').formValidator({autotip:true,onshow:"<?php echo L('please_select_course_agency')?>",onfocus:"<?php echo L('please_select_course_agency')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_select_course_agency')?>"});
	$('#class').formValidator({autotip:true,onshow:"<?php echo L('please_select_course_class')?>",onfocus:"<?php echo L('please_select_course_class')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('please_select_course_class')?>"});
	$("input:checkbox[name='course[day][]']").formValidator({
		autotip:true,
		onshow : "<?php echo L('please_select_day')?>",
		onfocus : "<?php echo L('please_select_day')?>",
		oncorrect : "<?php echo L('right')?>"
		}).inputValidator({
		min : 1,
		onerror : "<?php echo L('please_select_day')?>"
		});
	$("#price").formValidator({onshow: "请输入价格",onfocus: "请输入价格", onCorrect: "输入正确", empty: true, onempty:"输入价格为空"}).regexValidator({ regexp:'^[0-9]*[1-9][0-9]*$', onerror: "输入格式不正确！" });
});
</script>
<form method="post" action="?m=<?php echo ROUTE_M;?>&c=<?php echo ROUTE_C;?>&a=<?php echo ROUTE_A;?>" id="myform">
	<div class="pad-10">
		<div class="col-tab">
			<div id="div_info_1" class="contentList pad-10">
				<table width="100%" class="table_form ">
					<tbody>
						<tr>
							<th width="200"><?php echo L('course_name')?>：</th>
							<td><input name="course[name]" id="coursename" class="input-text" type="text" size="40"></td>
						</tr>
						<tr>
							<th><?php echo L('course_agency')?>：</th>
							<td><?php echo form::select($agency_new, 0,'name="course[agency]" id="agency"','请选择所属机构')?></td>
						</tr>
						<tr>
							<th><?php echo L('course_class')?>：</th>
							<td>
								<?php 
									$day = array(
											'1'=>'周一',
											'2'=>'周二',
											'3'=>'周三',
											'4'=>'周四',
											'5'=>'周五',
											'6'=>'周六',
											'7'=>'周日',
									);
									echo form::checkbox($day,0,'name="course[day][]"');
								?>
							</td>
						</tr>
						<tr>
							<th><?php echo L('type')?>：</th>
							<td>
								<?php 
									$type = array(
											'1'=>'少儿课程',
											'2'=>'成人课程',
									);
									echo form::radio($type,1,'name="course[type]"');
								?>
							</td>
						</tr>
						<tr>
							<th><?php echo L('course_image_square')?>：</th>
							<td><?php echo form::images('course[image_square]', 'image_square', '', 'course', '', 40)?><!-- <font color="red">为保证显示效果，请上传宽高为500*500的图片</font> --></td>
						</tr>
						<tr>
							<th><?php echo L('course_image_horizontal')?>：</th>
							<td><?php echo form::images('course[image_horizontal]', 'image_horizontal', '', 'course', '', 40)?><!-- <font color="red">为保证显示效果，请上传宽高为500*340的图片</font> --></td>
						</tr>
						<tr>
							<th><?php echo L('course_image_vertical')?>：</th>
							<td><?php echo form::images('course[image_vertical]', 'image_vertical', '', 'course', '', 40)?><!-- <font color="red">为保证显示效果，请上传宽高为500*650的图片</font> --></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_price')?>：</th>
							<td><input name="course[price]" id="price" class="input-text" type="text" size="40"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('period')?>：</th>
							<td><input name="course[period_zhouqi]" id="period_zhouqi" class="input-text" type="text" size="40" placeholder='请输入该课程的周期,如：四周...'></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_period')?>：</th>
							<td><textarea rows="5" cols="60" name="course[period]" id="period"></textarea></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_time')?>：</th>
							<td><textarea rows="5" cols="60" name="course[time]" id="time"></textarea></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_object')?>：</th>
							<td><textarea rows="5" cols="60" name="course[object]" id="object"></textarea></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_target')?>：</th>
							<td><textarea rows="5" cols="60" name="course[target]" id="target"></textarea></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_special')?>：</th>
							<td><textarea name="course[special]" id="special"></textarea><?php echo form::editor('special','full','','','',1,1,'')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('course_content')?>：</th>
							<td><textarea name="course[content]" id="content"></textarea><?php echo form::editor('content','full','','','',1,1,'')?></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="bk15"></div>
			<?php if($action_source=="talent_categroy"){ ?>
				<input type="hidden" name="catid" value="<?= $catid?>">
				<input type="hidden" name="id" value="<?= $id?>">
				<input type="hidden" name="source_type" value="<?= $source_type?>">
			<?php }?>
			<input name="dosubmit" type="submit"   <?php if($action_source=="contestant" || $action_source=="talent_categroy"){ ?>class="dialog "  <?php }else{ ?>class="button" <?php }?>id="dosubmit"  value="<?php echo L('submit')?>" >
			<?php if($action_source=="contestant"){ ?><input type="hidden" name="contest_id" value="<?= $contest_id?>"><?php }?>
		</div>
</div>
</form>

</body>
</html>